package com.jiao;

import org.jetbrains.annotations.NotNull;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.ResourceBundle;
import java.util.function.Predicate;

public class SanGengSelector implements ImportSelector {
    @NotNull
    @Override
    public String[] selectImports(@NotNull AnnotationMetadata importingClassMetadata) {
        //      3.加载import.properties文件中的多个类名
        ResourceBundle bundle = ResourceBundle.getBundle("import");
        String className = bundle.getString("className");
        return className.split(",");
    }
  
    @Override
    public Predicate<String> getExclusionFilter() {
        return s -> s.contains("Admin");
    }
}